<html>
<head><meta charset="utf-8"><title>bound-tys · wg-traits · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/index.html">wg-traits</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html">bound-tys</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="135620832"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135620832" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135620832">(Oct 11 2018 at 16:47)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I have a question, why do we need <code>InferTy::CanonicalTy</code> in rustc? Couldn't we just re-use <code>InferTy::TyVar</code> / <code>InferTy::IntVar</code> / <code>InferTy::FloatVar</code>?</p>



<a name="135624956"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135624956" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135624956">(Oct 11 2018 at 18:01)</a>:</h4>
<p>we could, but then things are less robust</p>



<a name="135624967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135624967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135624967">(Oct 11 2018 at 18:01)</a>:</h4>
<p>I would rather use <code>BoundVar</code></p>



<a name="135624971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135624971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135624971">(Oct 11 2018 at 18:01)</a>:</h4>
<p>and keep <code>TyVar</code> to represent free types</p>



<a name="135624987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135624987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135624987">(Oct 11 2018 at 18:01)</a>:</h4>
<p>(which reminds me, I have to get back to that chalk PR)</p>



<a name="135624999"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135624999" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135624999">(Oct 11 2018 at 18:01)</a>:</h4>
<p>(in particular, if we move to bind-var, we should be able to share the substitution machinery etc)</p>



<a name="135626761"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135626761" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135626761">(Oct 11 2018 at 18:29)</a>:</h4>
<p>Ok, I'm currently trying to move to <code>BoundTy</code> in rustc</p>



<a name="135626792"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135626792" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135626792">(Oct 11 2018 at 18:29)</a>:</h4>
<p>my current definition is the following:</p>
<div class="codehilite"><pre><span></span>pub enum TyKind {
    ...
    Bound(DebruijnIndex, BoundTy),
}

pub struct BoundTy {
    pub idx: u32,
    pub kind: BoundTyKind,
}

pub enum BoundTyKind {
    Anon,
    Param(InternedString),
}
</pre></div>



<a name="135626853"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135626853" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135626853">(Oct 11 2018 at 18:30)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> what do you think of it?</p>



<a name="135627012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135627012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135627012">(Oct 11 2018 at 18:32)</a>:</h4>
<p>the role of <code>BoundTyKind</code> is basically for printouts?</p>



<a name="135627042"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135627042" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135627042">(Oct 11 2018 at 18:33)</a>:</h4>
<p>seems good, anyway</p>



<a name="135627149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135627149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135627149">(Oct 11 2018 at 18:35)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes it's for printouts</p>



<a name="135669209"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135669209" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135669209">(Oct 12 2018 at 11:20)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I'm having trouble figuring out how we will unify bound tys and regions in <code>SubstFolder</code></p>



<a name="135669221"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135669221" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135669221">(Oct 12 2018 at 11:20)</a>:</h4>
<p>as far as I understand, <code>SubstFolder</code> only substitutes early bound regions</p>



<a name="135669243"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135669243" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135669243">(Oct 12 2018 at 11:21)</a>:</h4>
<p>however, we cannot use early bound regions to express bound regions in a "general way", we rather need to use late bound regions ... which are substituted through another routine</p>



<a name="135829352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135829352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135829352">(Oct 15 2018 at 13:10)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> yes. I was imagining that we would treat "bound tys" as "late-bound" and use those other routines to do the substitution</p>



<a name="135829360"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135829360" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135829360">(Oct 15 2018 at 13:10)</a>:</h4>
<p>is there a time when we have to "mix"?</p>



<a name="135829421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135829421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135829421">(Oct 15 2018 at 13:12)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ok then in that case, I don't think so</p>



<a name="135888941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135888941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135888941">(Oct 16 2018 at 09:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> do we want the <code>BoundTy</code> variant in <code>enum TyKind</code> or rather in <code>enum InferTy</code>?</p>



<a name="135888960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135888960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135888960">(Oct 16 2018 at 09:31)</a>:</h4>
<p>also if we change <code>CanonicalTy</code> to <code>BoundTy</code>, what about <code>ReCanonical</code>? Do we still want that region variant? Couldn't we use <code>ReLateBound</code>?</p>



<a name="135889491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/135889491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#135889491">(Oct 16 2018 at 09:43)</a>:</h4>
<p>I think it should go in <code>TyKind</code> probably, and I also think that <code>ReCanonical</code> can go away, yes</p>



<a name="136354771"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136354771" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136354771">(Oct 23 2018 at 18:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> what should I do about the <code>HAS_CANONICAL_VARS</code> flag? Can I just remove it?</p>



<a name="136356484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136356484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136356484">(Oct 23 2018 at 18:24)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> I suppose so</p>



<a name="136367016"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136367016" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136367016">(Oct 23 2018 at 21:01)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I think I'm seeing the end, but now that I moved from <code>ReCanonical</code> to <code>ReLateBound</code> I hit this assertion: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints/mod.rs#L692-L697" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints/mod.rs#L692-L697">https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints/mod.rs#L692-L697</a> (called from <code>InferCtxt::make_query_response</code>)</p>



<a name="136367093"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136367093" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136367093">(Oct 23 2018 at 21:02)</a>:</h4>
<p>I did not try to understand what is happening in that function yet</p>



<a name="136398783"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136398783" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136398783">(Oct 24 2018 at 10:00)</a>:</h4>
<p>I'll take a look in a bit :)</p>



<a name="136398885"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136398885" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136398885">(Oct 24 2018 at 10:02)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> can you point me at your diffs and/or open a WIP PR?</p>



<a name="136398899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136398899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136398899">(Oct 24 2018 at 10:02)</a>:</h4>
<p>sounds like you are missing a substitution or something <em>somewhere</em></p>



<a name="136399115"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136399115" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136399115">(Oct 24 2018 at 10:07)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes that's what I'm thinking too</p>



<a name="136399149"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136399149" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136399149">(Oct 24 2018 at 10:08)</a>:</h4>
<p>this is the full diff: <a href="https://github.com/rust-lang/rust/compare/master...scalexm:bound-ty" target="_blank" title="https://github.com/rust-lang/rust/compare/master...scalexm:bound-ty">https://github.com/rust-lang/rust/compare/master...scalexm:bound-ty</a></p>



<a name="136399175"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136399175" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136399175">(Oct 24 2018 at 10:08)</a>:</h4>
<p>but the problem is with the last commit: <a href="https://github.com/rust-lang/rust/commit/8051a2be5f9a9190974cbebe877672b6081cf7ce" target="_blank" title="https://github.com/rust-lang/rust/commit/8051a2be5f9a9190974cbebe877672b6081cf7ce">https://github.com/rust-lang/rust/commit/8051a2be5f9a9190974cbebe877672b6081cf7ce</a> (which tries to remove <code>ReCanonical</code>)</p>



<a name="136399711"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136399711" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136399711">(Oct 24 2018 at 10:19)</a>:</h4>
<p>It may be the canonical substitution that is wrong (I just tweaked the original one, but eventually I’d like to extend <code>ty::fold::RegionReplacer</code> to replace both bound regions and types, and use that for canonical substitution as well)</p>



<a name="136420637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420637">(Oct 24 2018 at 16:26)</a>:</h4>
<p>oh <span class="user-mention" data-user-id="131694">@scalexm</span> I forgot to look at this</p>



<a name="136420638"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420638" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420638">(Oct 24 2018 at 16:26)</a>:</h4>
<p>did you figure it out?</p>



<a name="136420643"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420643" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420643">(Oct 24 2018 at 16:26)</a>:</h4>
<p>also, it so happens that the code I wrote now is trying to canonicalize a value that contains a canonical vaule</p>



<a name="136420647"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420647" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420647">(Oct 24 2018 at 16:26)</a>:</h4>
<p>annoying that your branch has not already landed :P</p>



<a name="136420654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420654">(Oct 24 2018 at 16:26)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> not yet, I'm still trying to debug</p>



<a name="136420683"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420683" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420683">(Oct 24 2018 at 16:27)</a>:</h4>
<p>ok if you want I can start up a local build and try to trace it</p>



<a name="136420688"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420688" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420688">(Oct 24 2018 at 16:27)</a>:</h4>
<p>the commit is big enough it's hard for me to "just see" :)</p>



<a name="136420913"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420913" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420913">(Oct 24 2018 at 16:31)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes that might be helpful</p>



<a name="136420971"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420971" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420971">(Oct 24 2018 at 16:32)</a>:</h4>
<p>ok starting</p>



<a name="136420974"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420974" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420974">(Oct 24 2018 at 16:32)</a>:</h4>
<p>er, where is the branch?</p>



<a name="136420986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420986">(Oct 24 2018 at 16:32)</a>:</h4>
<p>ah, <code>bound-ty</code> on your repo</p>



<a name="136420996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136420996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136420996">(Oct 24 2018 at 16:32)</a>:</h4>
<p>yep</p>



<a name="136424467"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136424467" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136424467">(Oct 24 2018 at 17:32)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  oh ok I think I found something</p>



<a name="136424478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136424478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136424478">(Oct 24 2018 at 17:33)</a>:</h4>
<p><a href="https://github.com/scalexm/rust/blob/8051a2be5f9a9190974cbebe877672b6081cf7ce/src/librustc/infer/canonical/query_response.rs#L502-L504" target="_blank" title="https://github.com/scalexm/rust/blob/8051a2be5f9a9190974cbebe877672b6081cf7ce/src/librustc/infer/canonical/query_response.rs#L502-L504">https://github.com/scalexm/rust/blob/8051a2be5f9a9190974cbebe877672b6081cf7ce/src/librustc/infer/canonical/query_response.rs#L502-L504</a></p>



<a name="136424487"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136424487" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136424487">(Oct 24 2018 at 17:33)</a>:</h4>
<p>the <code>skip_binder</code> is wrong, because "canonical" late bound regions are adjusted with the binder</p>



<a name="136425895"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136425895" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136425895">(Oct 24 2018 at 18:00)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> ah</p>



<a name="136425923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136425923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136425923">(Oct 24 2018 at 18:01)</a>:</h4>
<p>indeed, should be not so hard to fix I wouldn't think tho</p>



<a name="136426491"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136426491" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136426491">(Oct 24 2018 at 18:10)</a>:</h4>
<p>so I now see the failure, but maybe I won't look any further <span class="user-mention" data-user-id="131694">@scalexm</span> ?</p>



<a name="136426986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136426986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136426986">(Oct 24 2018 at 18:19)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> the build with the fix is still not finished yet but I think this is good yes</p>



<a name="136427082"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136427082" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136427082">(Oct 24 2018 at 18:21)</a>:</h4>
<p>nice</p>



<a name="136433072"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136433072" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136433072">(Oct 24 2018 at 20:04)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> is it fine to rename <code>Binder::no_late_bound_regions</code> to <code>Binder::no_escaping_vars</code>?</p>



<a name="136433146"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136433146" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136433146">(Oct 24 2018 at 20:06)</a>:</h4>
<p>or <code>no_escaping_bound_vars</code></p>



<a name="136433156"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136433156" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136433156">(Oct 24 2018 at 20:06)</a>:</h4>
<p>seems fine</p>



<a name="136440166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136440166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136440166">(Oct 24 2018 at 22:17)</a>:</h4>
<p>hey <span class="user-mention" data-user-id="116009">@nikomatsakis</span>. you round?</p>



<a name="136441152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136441152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136441152">(Oct 24 2018 at 22:38)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> PR up: <a href="https://github.com/rust-lang/rust/pull/55330" target="_blank" title="https://github.com/rust-lang/rust/pull/55330">https://github.com/rust-lang/rust/pull/55330</a></p>



<a name="136441274"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136441274" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136441274">(Oct 24 2018 at 22:40)</a>:</h4>
<p>I have a test failing locally: <code>src/test/run-pass/rustc-rust-log.rs</code>, but it's weird because compiletest tells me that it encountered an explicit panic, whereas when I run <code>RUST_LOG=debug rustc src/test/run-pass/rustc-rust-log.rs</code> with my stage 1 compiler, everything is fine</p>



<a name="136476044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136476044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136476044">(Oct 25 2018 at 13:14)</a>:</h4>
<p>that is weird; sometimes it's due to <code>// compile-flags</code>, maybe?</p>



<a name="136476051"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136476051" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136476051">(Oct 25 2018 at 13:15)</a>:</h4>
<p>hmm maybe not</p>



<a name="136476062"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136476062" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136476062">(Oct 25 2018 at 13:15)</a>:</h4>
<p>I think you can use <code>-vv</code> or something to see the <em>exact</em> command being executed</p>



<a name="136476070"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136476070" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136476070">(Oct 25 2018 at 13:15)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> I left a review of your PR</p>



<a name="136481102"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136481102" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136481102">(Oct 25 2018 at 14:34)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> Ok fixed</p>



<a name="136481145"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136481145" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136481145">(Oct 25 2018 at 14:35)</a>:</h4>
<p>did you have a look at the perf run: <a href="https://perf.rust-lang.org/compare.html?start=f99911a4a0bead7dd1f9ef2f90442844434cc391&amp;end=2b86a36d9530d0a26855c5a8ec6759e21fce2efc" target="_blank" title="https://perf.rust-lang.org/compare.html?start=f99911a4a0bead7dd1f9ef2f90442844434cc391&amp;end=2b86a36d9530d0a26855c5a8ec6759e21fce2efc">https://perf.rust-lang.org/compare.html?start=f99911a4a0bead7dd1f9ef2f90442844434cc391&amp;end=2b86a36d9530d0a26855c5a8ec6759e21fce2efc</a> ? I'm not sure how to interpret it</p>



<a name="136482119"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136482119" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136482119">(Oct 25 2018 at 14:47)</a>:</h4>
<p>I was just worried about degrading the perfs of canonical substitution because we lose the inlining of the var replacement machinery, now that this is done through the <code>fld_t</code> and <code>fld_r</code> function pointers</p>



<a name="136485941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136485941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136485941">(Oct 25 2018 at 15:35)</a>:</h4>
<blockquote>
<p>did you have a look at the perf run: <a href="https://perf.rust-lang.org/compare.html?start=f99911a4a0bead7dd1f9ef2f90442844434cc391&amp;end=2b86a36d9530d0a26855c5a8ec6759e21fce2efc" target="_blank" title="https://perf.rust-lang.org/compare.html?start=f99911a4a0bead7dd1f9ef2f90442844434cc391&amp;end=2b86a36d9530d0a26855c5a8ec6759e21fce2efc">https://perf.rust-lang.org/compare.html?start=f99911a4a0bead7dd1f9ef2f90442844434cc391&amp;end=2b86a36d9530d0a26855c5a8ec6759e21fce2efc</a> ? I'm not sure how to interpret it</p>
</blockquote>
<p>yes, it looked like "no difference" to me</p>



<a name="136792383"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136792383" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136792383">(Oct 30 2018 at 17:28)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> question abound bound vars in the <code>environment</code> query (same as <code>param_env</code> but for chalk)</p>



<a name="136792438"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136792438" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136792438">(Oct 30 2018 at 17:29)</a>:</h4>
<p>currently the result of this query contains type params / early bound regions coming from the generics of the def_id</p>



<a name="136792446"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136792446" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136792446">(Oct 30 2018 at 17:29)</a>:</h4>
<p>should I replace them with bound vars instead?</p>



<a name="136792518"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136792518" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136792518">(Oct 30 2018 at 17:30)</a>:</h4>
<p>I guess that when we call this query, we next replace these bound vars with placeholder types/regions corresponding to the universally instantiated params</p>



<a name="136792781"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136792781" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136792781">(Oct 30 2018 at 17:34)</a>:</h4>
<p>good question, yes</p>



<a name="136795979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136795979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136795979">(Oct 30 2018 at 18:21)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> I <em>think</em> I expected them to just stay roughly as they are to start; they are effectively placeholders, but in U0, so we can just treat them like any other nominal type I think? I guess this is not true around negative queries though</p>



<a name="136795989"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136795989" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136795989">(Oct 30 2018 at 18:21)</a>:</h4>
<p>that said, I would like to move to a place where we model them as bound-types</p>



<a name="136795990"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136795990" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136795990">(Oct 30 2018 at 18:21)</a>:</h4>
<p>in a uniform way</p>



<a name="136796003"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136796003" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136796003">(Oct 30 2018 at 18:22)</a>:</h4>
<p>ah well — I see that we would want to replace them with bound types when creating (e.g.) program clauses</p>



<a name="136796046"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136796046" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136796046">(Oct 30 2018 at 18:22)</a>:</h4>
<p>but I guess that's somewhat separate</p>



<a name="136796374"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136796374" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136796374">(Oct 30 2018 at 18:26)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> yes so currently I replaced every type parameters in program clauses with bound vars</p>



<a name="136796396"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136796396" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136796396">(Oct 30 2018 at 18:27)</a>:</h4>
<p>(Bound at index 0 with the <code>Clause::ForAll</code> variant)</p>



<a name="136796432"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136796432" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136796432">(Oct 30 2018 at 18:27)</a>:</h4>
<p>So I’m going to do the same with <code>environment</code>, which will now return a <code>ty::Binder&lt;Environment&gt;</code></p>



<a name="136796562"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136796562" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136796562">(Oct 30 2018 at 18:29)</a>:</h4>
<p>Also now thanks to bound types I can also use them as « anonymous » types to express some built-in program clauses that were not writable before</p>



<a name="136796611"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136796611" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136796611">(Oct 30 2018 at 18:29)</a>:</h4>
<p>e.g. <code>forall&lt;‘a, T&gt; { T: ‘a :- FromEnv(&amp;’a T) }</code></p>



<a name="136796882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136796882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136796882">(Oct 30 2018 at 18:33)</a>:</h4>
<p>ok</p>



<a name="136934729"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136934729" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136934729">(Nov 01 2018 at 16:59)</a>:</h4>
<p>oh, <span class="user-mention" data-user-id="131694">@scalexm</span>, not urgent, but it occurs to me that since we can now represent bound-types, we could probably cleanup some of the trait object code, so that we can e.g. use a BoundTy to represent the "unknown self type"</p>



<a name="136934780"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136934780" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136934780">(Nov 01 2018 at 17:00)</a>:</h4>
<p>basically a <code>exists&lt;T&gt; {...}</code> binder</p>



<a name="136934976"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136934976" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136934976">(Nov 01 2018 at 17:03)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ok</p>



<a name="136935024"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136935024" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136935024">(Nov 01 2018 at 17:04)</a>:</h4>
<p>Btw you told me once that placeholder types would be useful for the arbitrary self type RFC</p>



<a name="136935026"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136935026" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136935026">(Nov 01 2018 at 17:04)</a>:</h4>
<p>More info on that?</p>



<a name="136935043"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136935043" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136935043">(Nov 01 2018 at 17:04)</a>:</h4>
<p>Because I’m going to add placeholder types on top of your universes refactor 3, so that I can implement most of the chalk engine routines</p>



<a name="136935054"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136935054" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136935054">(Nov 01 2018 at 17:04)</a>:</h4>
<p>Ah, well, yes</p>



<a name="136935059"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136935059" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136935059">(Nov 01 2018 at 17:05)</a>:</h4>
<p>The PR in question has not landed though I hope it will soon</p>



<a name="136935073"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136935073" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136935073">(Nov 01 2018 at 17:05)</a>:</h4>
<p>I haven't heard from the author, <span class="user-mention" data-user-id="125273">@mikeyhew</span>, lately though</p>



<a name="136939044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136939044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136939044">(Nov 01 2018 at 18:05)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> btw niko do you think we could maybe set a priority for <a href="https://github.com/rust-lang/rust/pull/55305" target="_blank" title="https://github.com/rust-lang/rust/pull/55305">https://github.com/rust-lang/rust/pull/55305</a> and <a href="https://github.com/rust-lang/rust/pull/55330" target="_blank" title="https://github.com/rust-lang/rust/pull/55330">https://github.com/rust-lang/rust/pull/55330</a> (once rebased on top of the former)?</p>



<a name="136939079"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136939079" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136939079">(Nov 01 2018 at 18:05)</a>:</h4>
<p>I've started to write code that depends on both already, but I'm not very at ease with git and rebasing on top of multiple branches</p>



<a name="136939404"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136939404" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136939404">(Nov 01 2018 at 18:10)</a>:</h4>
<p>seems reasonable, yes..</p>



<a name="136942007"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136942007" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136942007">(Nov 01 2018 at 18:50)</a>:</h4>
<p>I gave 55305 p=1, <span class="user-mention" data-user-id="131694">@scalexm</span></p>



<a name="136953330"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/136953330" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mikeyhew <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#136953330">(Nov 01 2018 at 22:03)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I replied to your comment yesterday... we are talking about <a href="https://github.com/rust-lang/rust/pull/54383" target="_blank" title="https://github.com/rust-lang/rust/pull/54383">https://github.com/rust-lang/rust/pull/54383</a>, right?</p>



<a name="137032270"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137032270" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137032270">(Nov 02 2018 at 14:12)</a>:</h4>
<p><span class="user-mention" data-user-id="125273">@mikeyhew</span> so you did :)</p>



<a name="137032433"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137032433" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137032433">(Nov 02 2018 at 14:13)</a>:</h4>
<p>I was talking about that, yes. <span class="user-mention" data-user-id="131694">@scalexm</span> has added proper support for bound-types into rustc -- at least, I think it landed? I sort of forget. I don't think we're <em>quite</em> at that point where we can use them for that PR yet, but it's a prime example where we would want to.</p>



<a name="137044135"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137044135" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137044135">(Nov 02 2018 at 14:57)</a>:</h4>
<p>quick question <span class="user-mention" data-user-id="116009">@nikomatsakis</span> , if you are in this <code>else</code> branch: <a href="https://github.com/rust-lang/rust/blob/master/src/librustc/infer/canonical/canonicalizer.rs#L400-L402" target="_blank" title="https://github.com/rust-lang/rust/blob/master/src/librustc/infer/canonical/canonicalizer.rs#L400-L402">https://github.com/rust-lang/rust/blob/master/src/librustc/infer/canonical/canonicalizer.rs#L400-L402</a></p>



<a name="137044273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137044273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137044273">(Nov 02 2018 at 14:57)</a>:</h4>
<p>won't you miss some placeholder regions? I see that <code>CanonicalizeQueryResponse</code> canonicalizes placeholder regions, but has <code>self.any() == false</code></p>



<a name="137068189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137068189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Alexander Regueiro <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137068189">(Nov 02 2018 at 17:09)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> <code>create_substs_for_ast_trait_ref</code> is probalby what I want to edit then... but not sure how</p>



<a name="137068526"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137068526" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mikeyhew <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137068526">(Nov 02 2018 at 17:15)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ok cool, I look forward to using them. For the record, the only reason we need the <code>U</code> type is because using <code>dyn Trait</code> directly causes query cycles</p>



<a name="137069077"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137069077" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mikeyhew <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137069077">(Nov 02 2018 at 17:24)</a>:</h4>
<p>Does that mean that ExistentialPredicate would be replaced with Binder&lt;Predicate&gt; or something like that?</p>



<a name="137069170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137069170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mikeyhew <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137069170">(Nov 02 2018 at 17:26)</a>:</h4>
<p>Sorry that was a reply to this comment, looks like the "reply" button isn't very useful</p>
<blockquote>
<p>oh, <span class="user-mention" data-user-id="131694">@scalexm</span>, not urgent, but it occurs to me that since we can now represent bound-types, we could probably cleanup some of the trait object code, so that we can e.g. use a BoundTy to represent the "unknown self type"</p>
</blockquote>



<a name="137069483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137069483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137069483">(Nov 02 2018 at 17:31)</a>:</h4>
<p><span class="user-mention" data-user-id="125273">@mikeyhew</span> yes I guess so</p>



<a name="137072908"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137072908" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137072908">(Nov 02 2018 at 18:22)</a>:</h4>
<blockquote>
<p>won't you miss some placeholder regions? I see that <code>CanonicalizeQueryResponse</code> canonicalizes placeholder regions, but has <code>self.any() == false</code></p>
</blockquote>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> it's quite possible that code is now out of sync :(</p>



<a name="137072967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137072967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137072967">(Nov 02 2018 at 18:23)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> ok I just added <code>HAS_RE_PLACEHOLDER</code> in <code>needs_canonical_flags</code></p>



<a name="137072986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137072986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137072986">(Nov 02 2018 at 18:23)</a>:</h4>
<p>yes, seems good</p>



<a name="137073047"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137073047" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137073047">(Nov 02 2018 at 18:24)</a>:</h4>
<p>also, is universe canonicalization even a thing in rustc? Since we canonicalize everything to bound vars</p>



<a name="137073415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137073415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137073415">(Nov 02 2018 at 18:29)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> at present we are not canonicalizing universes, but I plan to do it at some point, the code is mostly set up for it</p>



<a name="137073421"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137073421" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137073421">(Nov 02 2018 at 18:29)</a>:</h4>
<p>well in particular we are not "compressing" unused universes</p>



<a name="137073481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137073481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137073481">(Nov 02 2018 at 18:30)</a>:</h4>
<p>(or renumbering)</p>



<a name="137073675"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137073675" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137073675">(Nov 02 2018 at 18:33)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span>  mmh ok, but I'm not sure where in the code would we be doing that, if I look in chalk this basically happens in two steps: first canonicalizing replaces inference variables with canonical bound vars and leaves placeholder variables untouched, second u-canonicalizing renumbers placeholder variables</p>



<a name="137073682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137073682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137073682">(Nov 02 2018 at 18:33)</a>:</h4>
<p>anyway this is something that can wait</p>



<a name="137073746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137073746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137073746">(Nov 02 2018 at 18:34)</a>:</h4>
<p><span class="user-mention" data-user-id="131694">@scalexm</span> yeah just ignore it for now :P I think we would just do it in the <code>canoncialize_query</code> call though (it's not something you want to do for <code>canonicalize_response</code>)</p>



<a name="137073750"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137073750" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nikomatsakis <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137073750">(Nov 02 2018 at 18:34)</a>:</h4>
<p>I don't think the chalk setup is ideal really</p>



<a name="137082484"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137082484" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137082484">(Nov 02 2018 at 21:02)</a>:</h4>
<p><span class="user-mention" data-user-id="116009">@nikomatsakis</span> I see that rustc's inference context tracks universes for type variables already, and I'm going to track them in canonicalization as well, but the inference table only tracks universes for unresolved type variables</p>



<a name="137082515"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137082515" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137082515">(Nov 02 2018 at 21:03)</a>:</h4>
<p>so I have two possible strategies: either make the inference context track universes for all variables (by e.g. adding a field to <code>TypeVariableData</code>), either try to resolve the variable during canonicalization (if it fails we know that the inference context gives the universe, if it succeeds replace the inference variable with the resolved value instead)</p>



<a name="137083222"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137083222" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137083222">(Nov 02 2018 at 21:16)</a>:</h4>
<p>well anyway I'll go for the new field in <code>TypeVariableData</code>, seems simpler</p>



<a name="137083682"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137083682" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137083682">(Nov 02 2018 at 21:24)</a>:</h4>
<p>ah no that wouldn't work since the universe indices change during unification</p>



<a name="137083687"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/144729-wg-traits/topic/bound-tys/near/137083687" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> scalexm <a href="https://rust-lang.github.io/zulip_archive/stream/144729-wg-traits/topic/bound-tys.html#137083687">(Nov 02 2018 at 21:24)</a>:</h4>
<p>ok so I'll go for the second strategy then lol</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>